package com.hopu.v1.pojo.system;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopu.v1.pojo.common.Save;
import com.hopu.v1.pojo.common.Update;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.hibernate.validator.constraints.Length;

/**
 * 
 * @TableName s_announcement
 */
@TableName(value ="s_announcement")
@Data
public class Announcement implements Serializable {
    /**
     * 公告id
     */
    @TableId(type = IdType.AUTO)
    private Integer announcementId;

    /**
     * 公告标题
     */
    @NotBlank(message = "公告标题不能为空",groups = {Save.class, Update.class})
    @Length(message = "公告标题不低于2位", min = 2,max = 50, groups = {Save.class, Update.class})
    private String announcementTitle;

    /**
     * 公告内容
     */
    @NotBlank(message = "公告内容不能为空",groups = {Save.class, Update.class})
    private String announcementContent;

    /**
     * 公告发布时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate announcementReleased;

    /**
     * 状态:0为未发布，1为发布
     */
    private Integer announcementStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}